find_package(Boost CONFIG COMPONENTS unit_test_framework REQUIRED)

function(def_test SOURCE)
  list(GET SOURCE 0 NAME)
  get_filename_component(NAME ${NAME} NAME_WE)
  string(MAKE_C_IDENTIFIER ${NAME} NAME)

  add_executable(${NAME} ${SOURCE})
  target_link_libraries(${NAME} PRIVATE Boost::unit_test_framework)
  target_compile_definitions(${NAME} PRIVATE BOOST_UNORDERED_FOA_TESTS)
  target_include_directories(${NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)

  add_test(NAME ${NAME} COMMAND ${NAME})
endfunction()

def_test(unordered/fwd_set_test.cpp)
def_test(unordered/fwd_map_test.cpp)
def_test(unordered/compile_set.cpp)
def_test(unordered/compile_map.cpp)
def_test(unordered/noexcept_tests.cpp)
def_test(unordered/incomplete_test.cpp)
def_test(unordered/simple_tests.cpp)
def_test(unordered/equivalent_keys_tests.cpp)
def_test(unordered/constructor_tests.cpp)
def_test(unordered/copy_tests.cpp)
def_test(unordered/move_tests.cpp)
def_test(unordered/post_move_tests.cpp)
def_test(unordered/assign_tests.cpp)
def_test(unordered/insert_tests.cpp)
def_test(unordered/insert_hint_tests.cpp)
def_test(unordered/emplace_tests.cpp)
def_test(unordered/erase_tests.cpp)
def_test(unordered/merge_tests.cpp)
def_test(unordered/find_tests.cpp)
def_test(unordered/at_tests.cpp)
def_test(unordered/load_factor_tests.cpp)
def_test(unordered/rehash_tests.cpp)
def_test(unordered/equality_tests.cpp)
def_test(unordered/swap_tests.cpp)
def_test(unordered/transparent_tests.cpp)
def_test(unordered/reserve_tests.cpp)
def_test(unordered/contains_tests.cpp)
def_test(unordered/erase_if.cpp)
def_test(unordered/scary_tests.cpp)
def_test(unordered/init_type_insert_tests.cpp)
def_test(unordered/max_load_tests.cpp)
def_test(unordered/extract_tests.cpp)
def_test(unordered/node_handle_tests.cpp)
def_test(unordered/uses_allocator.cpp)
def_test("unordered/link_test_1.cpp;unordered/link_test_2.cpp")
def_test(unordered/scoped_allocator.cpp)
def_test(unordered/hash_is_avalanching_test.cpp)
def_test(exception/constructor_exception_tests.cpp)
def_test(exception/copy_exception_tests.cpp)
def_test(exception/assign_exception_tests.cpp)
def_test(exception/move_assign_exception_tests.cpp)
def_test(exception/insert_exception_tests.cpp)
def_test(exception/erase_exception_tests.cpp)
def_test(exception/rehash_exception_tests.cpp)
def_test(exception/swap_exception_tests.cpp)
def_test(exception/merge_exception_tests.cpp)
